 {layout name="common/layout" /}
 <style>
 .fare_temAdd>a{
	 height: 40px;
	 line-height: 40px;
	 width: 200px;
	 border-radius: 5px;
 }
 .fare_list{
	 margin-top: 0;
 }
 .fare_temAdd{
	 height: 20px;
 }
 </style>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<div class="Hui-article-box" style="margin-top: 37px;">
	<div class="newCrumbs ">物流模板
		<span class="c-gray en">&gt;</span> 运费模板
	</div>
	<div class="Hui-article">
		<!-- 模板添加操作 -->
		<div class="fare_temAdd">
			<a href="{:url('homeService')}">添加上门运费模板</a>
			<a href="{:url('add')}">添加快递运费模板</a>
		</div>
		<div>
			<div class="cl">
				<!-- 运费模板列表图 -->
				<ul class="mt-uls fare_list">
					{volist name="$data.freight_list" id="freight"} {if condition="$freight.freight_tpl_type eq 1"}
					<!-- 快递运费模板 -->
					<li>
						<h2 class="fare_title">快递运费模版-{$freight.freight_name}</h2>
						<div class="fare_content">
							<div class="fare_action">
								<p class="pt2"><a href="{:url('edit', ['id'=>$freight['freight_id']])}"><i class="Hui-iconfont">&#xe60c;</i></a>&nbsp;&nbsp;&nbsp;&nbsp;
									<span style="color: #2196f3;cursor: pointer;" onclick="del({$freight['freight_id']});"><i class="Hui-iconfont">&#xe609;</i></span>
								</p>
							</div>
							<div class="fare_table fare_tableTop">
								<table class="table table-border table-bg  table-bordered">
									<tr class="text-c text-cs first-tr">
										<th style="width: 220px;">运送范围</th>
										<th>首件</th>
										<th>续件</th>
									</tr>
									<tr style="height: 70px;" class="text-c">
										<td style="width: 220px;">
											{$freight.date}
										</td>
										<td>{$freight.freight_first_price}</td>
										<td>{$freight.freight_continued_price}</td>
									</tr>
								</table>
							</div>
						</div>
					</li>
					{else /}
					<!-- 上门运费模板 -->
					<li>
						<h2 class="fare_title">上门运费模版-{$freight.freight_name}</h2>
						<div class="fare_content">
							<div class="fare_action">
								<p class="pt2"><a href="{:url('editHomeService', ['id'=>$freight['freight_id']])}"><i class="Hui-iconfont">&#xe60c;</i></a>&nbsp;&nbsp;&nbsp;&nbsp;
								<span style="color: #2196f3;cursor: pointer;" onclick="del({$freight['freight_id']});"><i class="Hui-iconfont">&#xe609;</i></span>
							</div>
							<div class="fare_table fare_tableBottom">
								<table class="table table-border table-bg  table-bordered">
									<tr class="text-c text-cs first-tr">
										<th>运送范围</th>
										<th>运费</th>
									</tr>
									<tr style="height: 70px;" class="text-c">
										<td>{$freight.date}</td>
										<td>{$freight.freight_door_cost}</td>
									</tr>
								</table>
							</div>
						</div>
					</li>
					{/if} {/volist}
				</ul>
			</div>
			<div class="cl" style="margin-top: 30px;margin-bottom: 20px;">
				{$data.freight_list->render()}
			</div>
		</div>
	</div>
</div>

<script>
	$(function () {
		$.Huitab("#tab_demo .tabBar span", "#tab_demo .tabCon", "current", "click", "0")
	});
	var GG = {
		"kk": function (mm) {
			var ym = mm;
		}
	}
	$("#paginate").initPage(71, 1, GG.kk);

	function del(id) {
		layer.msg('你确定要删除吗？', {
			time: 0,
			btn: ['确定', '取消'],
			area: ['250px', '120px'],
			btnAlign: 'c',
			yes: function (index) {
				layer.close(index);
				$.ajax({
					type: 'post',
					url: "{:url('del')}",
					dataType: 'json',
					data: {
						id: id
					},
					success: function (data) {
						if (data.status == 1) {
							layer.msg(data.msg, {
								offset: 't',
								anim: 5,
								success: function () {
									location.reload(true);
								}
							});
						}
					}
				});
			}
		});
	}
</script>